FileSystemPackageStore Constructor

Constructor that creates a FileSystemPackageStore.

Parent Type: FileSystemPackageStore

Namespace: Microsoft.LearningComponents.Storage

Assembly: Microsoft.LearningComponents.Storage.dll

Syntax
C#

public FileSystemPackageStore (
LearningStore learningStore,
string basePath,
ImpersonationBehavior impersonationBehavior

)

Parameters

learningStore

The LearningStore where packages in this store are kept.

basePath

The base path to which files should be 'stored'. That is, the Microsoft Learning Components core schema defines a base path for all packages. When packages are imported into LearningStore, they are copied to a subdirectory of this basePath directory.Every package is given a unique directory for its files when the package is added to the system. The application should not modify files in this directory. The directory must exist before calling this constructor.

impersonationBehavior

A user that has read/write access to the basePath location. In some cases, the identity must also have permission to remove files from the basePath. The constructor does not verify all the permissions are available. If the identity does not have the appropriate permissions, an exception may be thrown from other methods as those permissions are required.

Exceptions
Exception type Condition
ArgumentNullException

Thrown if any of the arguments is null.

DirectoryNotFoundException

Thrown if basePath is not an absolute path to an existing directory.

UnauthorizedAccessException

Thrown if impersonationBehavior does not have FileSystemRights.Read to the basePath directory.